﻿#region Using Statements
using DirectZZT.Shared.Core;
#endregion

namespace DirectZZT.Shared.World.Objects
{
    /// <summary>
    /// Represents the board edge ("Board edge") board object.
    /// </summary>
    [Export("Board edge")]
    [BoardObject(Identifier = "Board edge", Classification = BoardObjectClassification.Terrain, AllowBecome = false)]
    public sealed class BoardEdgeBoardObject : BoardObject
    {
        #region Properties

        /// <summary>
        /// Gets/sets the side of the board we are located at.
        /// </summary>
        public Direction Side { get; set; }

        /// <summary>
        /// Returns the capabilities for this board object.
        /// </summary>
        public override BoardObjectCapabilities Capabilities
        {
            get { return base.Capabilities | BoardObjectCapabilities.AllowOutsideBounds; }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the BoardEdgeBoardObject class.
        /// </summary>
        public BoardEdgeBoardObject()
        {
            this.Enabled = true;
            // the board edge is never visible (except maybe in DEBUG mode)
#if DEBUG
            this.Texture = "Textures/PlayfieldObjects/BoardEdge";
            this.Visible = true;
#endif
        }

        #endregion

        #region Methods

        /// <summary>
        /// In DirectZZT supported.
        /// </summary>
        /// <param name="featureSet"></param>
        /// <returns></returns>
        protected override bool CanAttachScript(FeatureSet featureSet)
        {
            return featureSet == FeatureSet.DirectZZT;
        }

        /// <summary>
        /// Handles collisions.
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public override CollisionResolveArgs OnCollide(CollisionArgs args)
        {
            // if this is the player, then leave the screen
            if (args.Object is IPlayerBoardObject)
            {
                IPlayerBoardObject player = (IPlayerBoardObject)args.Object;
            }

            return base.OnCollide(args);
        }

        #endregion
    }
}
